package com.sykj.qianxuezhan.server.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.sykj.qianxuezhan.bean.ShopUser;
import com.sykj.qianxuezhan.mapper.ShopUserMapper;
import com.sykj.qianxuezhan.server.ShopUserService;
import com.sykj.util.reponse.CommonEnum;
import com.sykj.util.reponse.ResultBody;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Author QianXuezhan
 * @Date 2020/7/18 23:41
 * @Description: TODO
 */
@Service
public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper,ShopUser> implements ShopUserService {
    @Autowired
    private  ShopUserMapper  shopUserMapper;

    /**
     * @Date:
     * @Description: 查询店主信息
     **/
    @Override
    public List<ShopUser> queryShopUserDz(ShopUser shopUser) {
        return shopUserMapper.queryShopUserDz(shopUser);
    }

    /**
     * @Date:
     * @Description: 添加用户信息
     * @return*/
    @Override
    public ResultBody saveShopUser(ShopUser shopUser) {
         shopUserMapper.saveShopUser(shopUser);
        return  new ResultBody(CommonEnum.SUCCESS);
    }

    @Override
    public ShopUser queryCompare(String account) {
        return shopUserMapper.queryCompare(account);
    }

    @Override
    public ResultBody updateShopUserId(ShopUser shopUser) {
         shopUserMapper.updateShopUserId(shopUser);
        return new ResultBody(CommonEnum.SUCCESS);
    }

    /**
    * @Description: 查询员工信息
    **/
    @Override
    public List<ShopUser> queryShopUserYg(ShopUser shopUser) {

        return shopUserMapper.queryShopUserYg(shopUser);
    }

    @Override
    public ResultBody updateShopUserYg(ShopUser shopUser) {
        shopUserMapper.updateShopUserYg(shopUser);
        return new ResultBody( CommonEnum.SUCCESS);
    }


}
